package com.yuyou.tas.job;

import javax.annotation.PreDestroy;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import com.netflix.discovery.DiscoveryManager;

@EnableFeignClients(basePackages = {
		"com.yuyou.tas.service.api.lesson.service",
		"com.yuyou.tas.service.api.admin.service",
		"com.yuyou.tas.service.api.report.service",
		"com.yuyou.tas.service.api.feedback.service"})
@EnableDiscoveryClient
@SpringBootApplication
@EnableTransactionManagement
@EnableScheduling
public class TasJobApplication {

	public static void main(String[] args) {
		SpringApplication.run(TasJobApplication.class, args);
	}
	
	@SuppressWarnings("deprecation")
	@PreDestroy
	public void dostory() {
		DiscoveryManager.getInstance().shutdownComponent();
	}
}
